// This is a JavaScript module that is loaded on demand. It can export any number of
// functions, and may import other JavaScript modules if required.

export function initializeContextMenu(id) {
    document.addEventListener("contextmenu", function (event) {
        event.preventDefault();
        var menu = document.getElementById(id);
        menu.style.display = "block";
        menu.style.left = event.clientX + "px";
        menu.style.top = event.clientY + "px";
    });

    document.addEventListener("click", function (event) {
        var menu = document.getElementById(id);
        menu.style.display = "none";
    });
}

